﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;

namespace StudySL4BizApp.Web.Models
{
    public static class CommonRules
    {
        public static ValidationResult MustBiggerThanZero(short value, ValidationContext validationContext)
        {
            if (value <= 0)
            {
                return new ValidationResult("Quantity must above zero", new string[] { "Quantity" });
            }

            return ValidationResult.Success;
        }
    }
}